package com.cdq.che.dao;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.cdq.che.entity.Che_info;
import com.cdq.che.entity.Che_online;
import com.cdq.che.entity.CheMap;

import com.cdq.che.dao.Che_infoDao;
import com.cdq.che.dao.Che_onlineDao;
import com.cdq.che.dao.CheMapDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig che_infoDaoConfig;
    private final DaoConfig che_onlineDaoConfig;
    private final DaoConfig cheMapDaoConfig;

    private final Che_infoDao che_infoDao;
    private final Che_onlineDao che_onlineDao;
    private final CheMapDao cheMapDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        che_infoDaoConfig = daoConfigMap.get(Che_infoDao.class).clone();
        che_infoDaoConfig.initIdentityScope(type);

        che_onlineDaoConfig = daoConfigMap.get(Che_onlineDao.class).clone();
        che_onlineDaoConfig.initIdentityScope(type);

        cheMapDaoConfig = daoConfigMap.get(CheMapDao.class).clone();
        cheMapDaoConfig.initIdentityScope(type);

        che_infoDao = new Che_infoDao(che_infoDaoConfig, this);
        che_onlineDao = new Che_onlineDao(che_onlineDaoConfig, this);
        cheMapDao = new CheMapDao(cheMapDaoConfig, this);

        registerDao(Che_info.class, che_infoDao);
        registerDao(Che_online.class, che_onlineDao);
        registerDao(CheMap.class, cheMapDao);
    }
    
    public void clear() {
        che_infoDaoConfig.getIdentityScope().clear();
        che_onlineDaoConfig.getIdentityScope().clear();
        cheMapDaoConfig.getIdentityScope().clear();
    }

    public Che_infoDao getChe_infoDao() {
        return che_infoDao;
    }

    public Che_onlineDao getChe_onlineDao() {
        return che_onlineDao;
    }

    public CheMapDao getCheMapDao() {
        return cheMapDao;
    }

}
